package com.googlecode.cswish.view;


/**
 * @author Samlin.Zhang Date: 2008-6-13
 */
public class Column {
	private String namePrefix;
	private String shortName;
	private String type;
	private String label;
	private String property;
	private String displayProperty;
	private String sortable;
	private String width;
	private boolean isRequired;
	private boolean isVisible;
	private boolean isReadonly;
	private boolean deleted;
	private String refId;

	public void setProperty(String property) {
		this.property = property;
	}

	public String getProperty() {
		return property;
	}

	public void setSortable(String sortable) {
		this.sortable = sortable;
	}

	public String getSortable() {
		return sortable;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public String getWidth() {
		return width;
	}
	
	public String getNamePrefix() {
		return namePrefix;
	}

	public void setNamePrefix(String namePrefix) {
		this.namePrefix = namePrefix;
	}

	public String getName(int index) {
		if (namePrefix == null) {
			return shortName;
		} else {
			return namePrefix + '[' + index + "]." + shortName;
		}
	}

	public void setShortName(String name) {
		this.shortName = name;
	}
	
	public String getShortName() {
		return shortName;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public boolean isVisible() {
		return isVisible;
	}

	public void setVisible(boolean isVisible) {
		this.isVisible = isVisible;
	}

	public boolean isRequired() {
		return isRequired;
	}

	public void setRequired(boolean isRequired) {
		this.isRequired = isRequired;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getRefId() {
		return refId;
	}

	public void setRefId(String refId) {
		this.refId = refId;
	}

	public String getDisplayProperty() {
		return displayProperty;
	}

	public void setDisplayProperty(String displayProperty) {
		this.displayProperty = displayProperty;
	}

	public boolean isReadonly() {
		return isReadonly;
	}

	public void setReadonly(boolean isReadonly) {
		this.isReadonly = isReadonly;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}
}